﻿var oldParrentIndex = 0;
$(document).ready(function(){
	loadSupportOnline();
	
    $("#nav ul.root-nav > li").hover(function(){   
		var curIndex = $(this).index();
		if(curIndex != oldParrentIndex) {
			$("#nav ul.root-nav > li").find('ul:first').css({visibility: "hidden"}); 
			oldParrentIndex = curIndex;
		} 
		$(this).find('ul:first').css({visibility: "visible", display: "none"}).show("500");
			
		
		
    }, function(){       	
		$(this).find('ul:first').css({visibility: "hidden"});
    });
	$("#nav ul.root-nav > li > ul > li").hover(function(){   
        $(this).find('ul:first').css({visibility: "visible", display: "none"}).delay("100").show("500");
    }, function(){
        $(this).find('ul:first').css({visibility: "hidden"});
    });
	
	$("#nav ul.root-nav > li").hover(function(){
		$(this).stop().addClass("hover").fadeTo('slow',0.5);
	}, function(){
		$(this).stop().removeClass("hover").fadeTo('slow',1);
	});
	
	
});
function loadSupportOnline() {
	$(document.body).append('<div class=\"support-wrapper\"></div>');
	setTimeout(function(){$('.support-wrapper').load('/js/support.js');},100);
}
window.onload = function() {
		$("#footer").css({top: ($(document).height()+20)+"px", "display":"block"});
		$("body").css({height: ($(document).height()+14)+"px"});	
	}

